package com.gitee.sentinelservice.controller;

import com.gitee.sentinelservice.service.SentinelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName SentinelController
 * @Description TODO
 * @Author xiongchao
 * @Date 2021/1/5 14:01
 **/
@RestController
public class SentinelController {

    @Autowired
    private SentinelService sentinelService;

    @GetMapping("/test1")
    public String testA(){
        return "this is testA -----------";
    }

    @GetMapping("/test2")
    public String testB(){
        return "this is testB -----------";
    }

    @GetMapping("/limit")
    public String limit (){
        return sentinelService.hello("测试QPS限流");
    }

    @GetMapping("/thread")
    public String thread(){
        return sentinelService.threadTest("线程测试");
    }

    @GetMapping("/fuse")
    public String fuse(@RequestParam(value = "str") String str){
        return sentinelService.fuse(str);

    }
}
